package com.hdw.job.batch.processor;

import com.hdw.common.constant.CommonConstant;
import com.hdw.common.util.SnowflakeIdWorker;
import com.hdw.job.batch.element.Column;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Set;

/**
 * Created by liujunlei on 2021/6/15.
 */
@Component
public class ChangeCursorResultProcessor implements ItemProcessor<Map<String,Object>,Map<String,Object>> {


    /**
     * 空值补全
     * @param stringObjectMap
     * @return
     * @throws Exception
     */
    @Override
    public Map<String, Object> process(Map<String, Object> stringObjectMap) throws Exception {
        Column value;
        for(Map.Entry<String, Object> entry:stringObjectMap.entrySet()) {
            value = (Column)entry.getValue();
            stringObjectMap.put(entry.getKey(),value.getRawData());
        }
        return stringObjectMap;
    }
}
